package com.gxa.system_setting.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gxa.common.R;
import com.gxa.common.entity.system_settings.BadWeather;
import com.gxa.common.entity.system_settings.RegionalOpening;
import com.gxa.system_setting.mapper.RegionalOpeningMapper;
import com.gxa.system_setting.service.RegionalOpeningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RegionalOpeningServiceImpl implements RegionalOpeningService {

    @Autowired
    private RegionalOpeningMapper regionalOpeningMapper;

    @Override
    public R queryRegionalOpeningList(Integer currentPage, Integer pageSize) {
        R r=new R();
        Integer startPage=(currentPage-1)*pageSize;
        r.setCode(200);
        r.setMessage("查询分页成功");
        List<RegionalOpening> regionalOpenings=regionalOpeningMapper.queryRegionalOpeningList(currentPage,pageSize);
        r.setData(regionalOpenings);
        return r;
    }

    @Override
    public R queryByKeyWord(String keyWord) {
        R r=new R();
        List<Map> mapList = regionalOpeningMapper.queryByKeyWord(keyWord);
        r.setCode(200);
        r.setMessage("查询成功");
        r.setData(mapList);
        return r;
    }
}
